home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / readm < prev    next >
Text File  |  1994-04-25  |  1KB  |  43 lines

  1. readm:
  2.  
  3. Syntax:    readm ( "filename" )
  4.  
  5. Description:
  6.  
  7.     Readm reads a generic matrix of data from the file denoted by
  8.     the argument. The return value is the newly created matrix.
  9.  
  10.     The file format is generic ASCII. The rows of the matrix are
  11.     separated by newlines, and the columns are separated by
  12.     whitespace. Unecessary newlines, either before, or after the
  13.     data will confuse readm, and will probably result in an error
  14.     message. Only one matrix can be stored in a file. If you need
  15.     to store more than one matrix in a file, use write(), and
  16.     read(). 
  17.  
  18.     Readm can only read in numeric matrices. The result of reading
  19.     in string matrices is undefined.
  20.  
  21.     Example:
  22.  
  23.     1 2 3 4
  24.     5 6 7 8
  25.     9 10 11 12
  26.  
  27.     The above values in a file called "test" would be read in like:
  28.  
  29.     > a = readm("test")
  30.      a =
  31.      matrix columns 1 thru 4
  32.             1          2          3          4  
  33.             5          6          7          8  
  34.             9         10         11         12  
  35.  
  36.     Readm exists to read in data from other programs. In many
  37.     cases a simple awk script will filter the other programs
  38.     output into one or more columns of data. readm() will read the
  39.     data into the matrix, then the matrix can be reshaped if
  40.     necessary.
  41.  
  42. See Also: reshape, writem
  43.